/// 状态状态
///
/// @since 2.4
///
/// 在Rust中，枚举与Java中的枚举类似。这里定义了一个枚举来表示ReadyState。
#[derive(Debug, PartialEq)]
pub enum ReadyState {
    Connection,
    Open,
    Closing,
    Closed,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_ready_state() {
        // 测试ReadyState枚举的各个状态
        assert_eq!(ReadyState::Connection, ReadyState::Connection);
        assert_eq!(ReadyState::Open, ReadyState::Open);
        assert_eq!(ReadyState::Closing, ReadyState::Closing);
        assert_eq!(ReadyState::Closed, ReadyState::Closed);

        // 打印ReadyState枚举的状态
        println!("{:?}", ReadyState::Connection);
        println!("{:?}", ReadyState::Open);
        println!("{:?}", ReadyState::Closing);
        println!("{:?}", ReadyState::Closed);
    }
}
